import Mock from "mockjs";
import { myMock } from "../mock.js";

myMock("options/getOptions", "get", () => {
  return Mock.mock({
    code: 0,
    msg: "mockData",
    "data|3-9": [
      {
        // 属性 id 是一个自增数，起始值为 1，每次增 1
        "id|+1": 1,
        label: "@cname",
        "children|1-10": [
          { label: "@province", "id|+1": 1 },
        ]
      },
    ],
  });
});

myMock("options/getOptionsByType", "get", ({ lx: number }) => {
  return Mock.mock({
    code: 0,
    msg: "mockData",
    "data|5-10": [
      {
        label: "@province",
        "id|+1": 1,
      },
    ],
  });
});